package com.api.user.followuser;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IUserApiService;
import com.zyncro.api.exceptions.ZyncroApiException;
import com.zyncro.api.model.UserFollowApiType;

@ContextConfiguration(locations = { "classpath:/user/user-context.xml" })
public class FollowUserNotContact extends AbstractApiTest {

	@Value("#{user_follower.appId}")
	private String userId;

	@Value("#{user_follower.password}")
	private String userPassword;

	@Value("#{org_users[notContact].appId}")
	private String userToFollow;

	@BeforeClass
	public void setUpVariables() {

		getApi().login(userId, userPassword);
	}

	@Test(expectedExceptions = ZyncroApiException.class)
	public void testFollowNotContact() throws ZyncroApiException {

		UserFollowApiType followType = UserFollowApiType.ALL;

		getApi().getService(IUserApiService.class).followUser(userToFollow, followType);

	}
}
